home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / t3_1 / risc_src.lha / risc_sources / xlib / make-exports.t < prev    next >
Text File  |  1990-06-05  |  2KB  |  77 lines

  1. (HERALD test (env tsys))
  2.  
  3. (define (get-defined file l)
  4.   (with-open-ports ((port (open (filename-with-type (->filename file) 't) 'in)))
  5.     (iterate loop ((form (read port)) (l l))
  6.       (cond ((eof? form) l)
  7.         ((atom? form) (loop (read port) l))
  8.         ((or (eq? (car form) 'define)
  9.          (eq? (car form) 'define-constant))
  10.          (let ((thing (cadr form)))
  11.            (let ((name (if (atom? thing) thing (car thing))))
  12.          (if (memq? name l)
  13.              (loop (read port) l)
  14.              (loop (read port) (cons name l))))))
  15.         (else
  16.          (loop (read port) l))))))
  17.  
  18. (define (make-exports files)
  19.   (do ((l '() (get-defined (car files) l))
  20.        (files files (cdr files)))
  21.       ((null? files)
  22.        (with-open-ports ((port (open '(xlib exports t) 'out)))
  23.      (format port '("(herald exports)~%(walk (lambda (x) "
  24.             "(*define standard-env x (*value xlib-env x)))"
  25.             "(quote ~g))~%")
  26.          l)))
  27.     (format t "~%~S" (car files))))
  28.  
  29. (make-exports 
  30.     '((xlib        depth)
  31.       (xlib     screen)
  32.       (xlib    visual)
  33.       (xlib    xarc)
  34.       (xlib    xchar2b)
  35.       (xlib    xcharstruct)
  36.       (xlib    xclasshint)
  37.       (xlib    xcolor)
  38.       (xlib    xcomposestatus)      
  39.       (xlib    xevent)
  40.       (xlib    xfontprop)
  41.       (xlib    xfontstruct)
  42.       (xlib    xgcvalues)
  43.       (xlib    xhostaddress)
  44.       (xlib    xiconsize)
  45.       (xlib    ximage)
  46.       (xlib    xkeyboardcontrol)
  47.       (xlib    xkeyboardstate)
  48.       (xlib    xmodifierkeymap)
  49.       (xlib    xpoint)
  50.       (xlib    xrectangle)
  51.       (xlib    xrmoptiondescrec)
  52.       (xlib    xrmvalue)
  53.       (xlib    xsegment)
  54.       (xlib    xsetwindowattributes)
  55.       (xlib    xsizehints)
  56.       (xlib    xstandardcolormap)
  57.       (xlib    xtextitem)
  58.       (xlib    xtextitem16)
  59.       (xlib   xtimecoord)
  60.       (xlib    xvisualinfo)
  61.       (xlib    xwindowattributes)
  62.       (xlib    xwindowchanges)
  63.       (xlib     xwmhints)
  64.       (xlib    xwss)
  65.       (xlib    xws2)
  66.       (xlib    xws3)
  67.       (xlib    xws4)
  68.       (xlib    xws5)
  69.       (xlib    xws6)
  70.       (xlib    xws7)
  71.       (xlib    xws8)
  72.       (xlib    xws9)
  73.       (xlib    xws10)
  74.       (xlib    xlibconstants)
  75.       (xlib    xlibtypes)))
  76.  
  77.